package BOOK_describe;

abstract class user_one {
    private String name;

    public user_one(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public abstract void menu();

    abstract void use_option(Bookshelves bookshelves,int choice);

}

class Manager_user extends user_one {//管理员
    System_function[] Options;//储存方法

    public Manager_user(String name) {
        super(name);
        this.Options = new System_function[]{
                new Exit(),
                new Find(),
                new Add(),
                new Del(),
                new Show()
        };
    }
    @Override
    public void menu() {
        System.out.println("********************");
        System.out.println("1,查找图书");
        System.out.println("2，新增图书");
        System.out.println("3，删除图书");
        System.out.println("4，显示图书");
        System.out.println("0，退出系统");
        System.out.println("********************");
        System.out.print("亲输入你的操作: ");
    }//菜单得打印

    @Override
    void use_option(Bookshelves bookshelves,int choice) {
        Options[choice].work(bookshelves,choice);
    }

}

class Common_user extends user_one {
    System_function[] Options;//储存方法

    public Common_user(String name) {
        super(name);
        this.Options = new System_function[]{
                new Exit(),
                new Find(),
                new Borrow(),
                new Revert(),
                new Show()
        };
    }
    @Override
    public void menu() {
        System.out.println("********************");
        System.out.println("1,查找图书");
        System.out.println("2，借阅图书");
        System.out.println("3，归还图书");
        System.out.println("4.展示图书");
        System.out.println("0，退出系统");
        System.out.println("********************");
        System.out.print("亲输入你的操作: ");
    }

    @Override
    void use_option(Bookshelves bookshelves,int choice) {
        Options[choice].work(bookshelves,choice);
    }

}

public class User_option {

}
